﻿using System.Web.Mvc;

namespace SusuCMS.Web.Areas.Admin
{
    public class AdminAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Admin";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Admin_login",
                "Admin/login",
                new { controller = "Account", action = "Login" }
            );

            context.MapRoute(
                "Home_index",
                "Admin/Home",
                new { controller = "Home", action = "Index" }
            );

            context.MapRoute(
                "PageType_default",
                "Admin/{websiteId}/{pageTypeId}/{controller}/{action}/{id}",
                new { controller = "Page", action = "Index", id = UrlParameter.Optional },
                new { websiteId = @"\d+", pageTypeId = @"\d+" }
            );

            context.MapRoute(
                "Website_default",
                "Admin/{websiteId}/{controller}/{action}/{id}",
                new { controller = "PageType", action = "Index", id = UrlParameter.Optional },
                new { websiteId = @"\d+" }
            );

            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );


        }
    }
}
